import 'dart:io';
import 'package:desktop_webview_window/desktop_webview_window.dart';
import 'package:flutter/material.dart';
import 'package:path/path.dart' as p;
import 'package:path_provider/path_provider.dart';

class DesktopExporter extends StatelessWidget{
  late Webview webview;
  String uri; 
  DesktopExporter(this.uri,String title){
      init(uri,title);
      
  }
  init(url,title) async{
    webview = await WebviewWindow.create(
            configuration: CreateConfiguration(
              windowHeight: 600,
              windowWidth: 800,
              title: title,
              titleBarTopPadding: Platform.isMacOS ? 20 : 0,
              userDataFolderWindows: await _getWebViewPath(),
            ),
    );
    webview.launch(uri);
  }
  Future<String> _getWebViewPath() async {
    final document = await getApplicationDocumentsDirectory();
    return p.join(
      document.path,
      'desktop_webview_window',
    );
  }

  @override
  Widget build(BuildContext context) {
     
      return Container();
  }

}


